<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditTestTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditTestLabel_idTest}" for="idTest" />
                    <h:inputText id="idTest" value="#{testController.selected.idTest}" title="#{bundle.EditTestTitle_idTest}" required="true" requiredMessage="#{bundle.EditTestRequiredMessage_idTest}"/>
                    <h:outputLabel value="#{bundle.EditTestLabel_testContent}" for="testContent" />
                    <h:inputText id="testContent" value="#{testController.selected.testContent}" title="#{bundle.EditTestTitle_testContent}" />
                    <h:outputLabel value="#{bundle.EditTestLabel_testName}" for="testName" />
                    <h:inputText id="testName" value="#{testController.selected.testName}" title="#{bundle.EditTestTitle_testName}" />
                    <h:outputLabel value="#{bundle.EditTestLabel_idTopic}" for="idTopic" />
                    <h:selectOneMenu id="idTopic" value="#{testController.selected.idTopic}" title="#{bundle.EditTestTitle_idTopic}" >
                        <f:selectItems value="#{topicController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{testController.update}" value="#{bundle.EditTestSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditTestViewLink}"/>
                <br />
                <h:commandLink action="#{testController.prepareList}" value="#{bundle.EditTestShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditTestIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
